import request from '@/utils/request'

// 创建报账管理
export function createLedger(data) {
  return request({
    url: '/team/ledger/create',
    method: 'post',
    data: data
  })
}

// 更新报账管理
export function updateLedger(data) {
  return request({
    url: '/team/ledger/update',
    method: 'put',
    data: data
  })
}

// 删除报账管理
export function deleteLedger(id) {
  return request({
    url: '/team/ledger/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除报账管理 */
export function deleteLedgerList(ids) {
  return request({
    url: `/team/ledger/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得报账管理
export function getLedger(id) {
  return request({
    url: '/team/ledger/get?id=' + id,
    method: 'get'
  })
}

// 获得报账管理分页
export function getLedgerPage(params) {
  return request({
    url: '/team/ledger/page',
    method: 'get',
    params
  })
}
// 导出报账管理 Excel
export function exportLedgerExcel(params) {
  return request({
    url: '/team/ledger/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}